<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="content">
        <img id="photo" alt="Image not available" />
    </div>

    <script>
        const urlParams = new URLSearchParams(window.location.search);
        const uid = urlParams.get('id');

        // Fetch the data from the API
        fetch(`http://192.168.1.173:3000/api/common/QrcodeInfo/${uid}`, {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            }
        })
        .then(response => response.json())
        .then(data => {
            const photoUrl = data.photoUrls; // Assuming photoUrls is a single URL string
            if (photoUrl) {
                // Update the image source
                document.getElementById('photo').src = photoUrl;
            } else {
                console.log("No photo URL found.");
            }
        })
        .catch(error => console.error('Error:', error));
    </script>

    <style>
        img {
            width: 100%;
            height: auto;
            object-fit: cover;
        }
    </style>
</body>
</html>